package com.valuegroup.smarttodo.ui.example;

import android.os.Bundle;

import com.valuegroup.smarttodo.R;
import com.valuegroup.smarttodo.data.vo.ArticleVo;
import com.valuegroup.smarttodo.plugins.recyclerview.group.GroupItemDecoration;
import com.valuegroup.smarttodo.plugins.recyclerview.group.GroupRecyclerView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 示例
 * 含浮动分组的列表
 */
public class ExampleGroupRecyclerActivity extends AppCompatActivity {

    @BindView(R.id.recyclerView)
    GroupRecyclerView mRecyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_example_group_recycler);
        ButterKnife.bind(this);


        mRecyclerView = findViewById(R.id.recyclerView);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerView.addItemDecoration(new GroupItemDecoration<String, ArticleVo>());
        mRecyclerView.setAdapter(new ArticleAdapter(this));
        mRecyclerView.notifyDataSetChanged();
    }
}
